package fin_enum

import "gitee.com/lailonghui/vehicle-supervision-framework/pkg/dicts"

// 财务-车辆退款-状态
type finVehBillRetStatus int

var FinVehBillRetStatus finVehBillRetStatus

// 待审核
func (c *finVehBillRetStatus) WaitApply() int {
	return -1
}

// 已审核
func (c *finVehBillRetStatus) ApplyPass() int {
	return 1
}

// 已退回
func (c *finVehBillRetStatus) HasReturn() int {
	return 2
}

// 已撤销
func (c *finVehBillRetStatus) HasCancel() int {
	return 3
}

func (c *finVehBillRetStatus) ToText(value int) string {
	switch value {

	case -1:
		return "待审核"

	case 1:
		return "已审核"

	case 2:
		return "已退回"

	case 3:
		return "已撤销"

	}
	return ""
}

func (c *finVehBillRetStatus) ToDict(value int) *dicts.IntDict {
	return &dicts.IntDict{
		Text:  c.ToText(value),
		Value: value,
	}
}

func (c *finVehBillRetStatus) ToValue(text string) int {
	switch text {

	case "待审核":
		return -1

	case "已审核":
		return 1

	case "已退回":
		return 2

	case "已撤销":
		return 3

	}
	return 0
}
